@extends('admin/layout')
@section('title','会员管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    <a href="{{asset('admin/member')}}">会员列表</a>
    <small>这是添加会员页面</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="{{asset('admin/index')}}"><i class="fa fa-th"></i> 管理首页</a></li>
    <li><i class="fa fa-users"></i> 会员管理</li>
    <li><a href="{{asset('admin/member')}}"><i class="fa fa-user"></i> 会员列表</a></li>
    <li class="active">添加会员</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
	  	  <!-- box start -->
          <div class="box box-info">
	        <div class="box-header with-border">
	          <h3 class="box-title"><i class="fa fa-user-plus"> 添加会员</i></h3>
	        </div>
            <!--这是账号和验证码错误信息-->         
            @if(session('error'))
            <div class="alert alert-danger">
       
                 {{session('error')}} 
            </div>          
            @endif

            <!--这是MemberController中store的验证错误信息-->
            @if (count($errors) > 0)
              <div class="alert alert-danger">
                  <ol>
                      @foreach ($errors->all() as $error)
                          <li>{{ $error }}</li>
                      @endforeach
                  </ol>
              </div>
           @endif
            <!-- form start -->
            <form class="form-horizontal" action="{{asset('admin/member')}}" method="post" enctype="multipart/form-data">
              {{csrf_field()}}
              <div class="box-body">
                <div class="form-group">
                  <label for="inputname" class="col-sm-2 col-md-2 control-label">会员名称：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="text" name="name" value="{{old('name')}}" class="form-control" id="inputname" placeholder="请输入会员名称">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  </span>
                </div>
                <div class="form-group {{--has-error--}}">
                  <label for="inputpassword"  class="col-sm-2 col-md-2 control-label">会员密码：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="password" name="password" class="form-control" id="inputrepassword" placeholder="请输入会员密码">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  <!-- <i class="fa fa-times text-red"> </i> -->
                  </span>
                </div>
                <div class="form-group {{--has-error--}}">
                  <label for="inputrepassword" name="repassword" class="col-sm-2 col-md-2 control-label">确认密码：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="password" name="repassword" class="form-control" id="inputrepassword" placeholder="请再次输入会员密码">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  <!-- <i class="fa fa-times text-red"> </i> -->
                  </span>
                </div>
                <div class="form-group">
                  <label for="inputphone" class="col-sm-2 col-md-2 control-label">手机号码：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="text" name="phone" value="{{old('phone')}}" class="form-control" id="inputphone" placeholder="请输入手机号码">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  </span>
                </div>
                <div class="form-group">
                  <label for="inputemail" class="col-sm-2 col-md-2 control-label">电子邮箱：</label>
                  <div class="col-sm-6 col-md-5">
                    <input type="text" name="email" value="{{old('email')}}" class="form-control" id="inputemail" placeholder="请输入电子邮箱">
                  </div>
                  <span class="help-block col-sm-4 col-md-5">
                  </span>
                </div>
                <div class="form-group">
                  <label for="inputpic" class="col-sm-2 col-md-2 control-label">上传头像：</label>
                  <div class="col-sm-10 col-md-10">
                    <input type="file" name="pic" value="{{old('pic')}}" class="" id="inputpic">
                  </div>
                  <span class="help-block col-sm-10 col-sm-offset-2 col-md-10 col-md-offset-2">
                  </span>
                </div>              
                <div class="form-group">
                  <label for="inputvcode" class="col-sm-2 col-md-2 control-label">验&nbsp;&nbsp;证&nbsp;&nbsp;码：</label>
                  <div class="col-sm-4 col-md-3">
                    <input type="text"  name="code" class="form-control" id="inputvcode" placeholder="请输入验证码">
                  </div>
        				  <div class="col-sm-6 col-md-7">
        				  	<img id="vc" alt="点击刷新" src="{{asset('admin/member/v_code/1')}}" style="height:36px;"/>
        				  </div>
        				  <script>
                    // alert($);
        				  	$('#vc').on('mouseover',function(){
        				  		$(this).css('cursor','pointer');
        				  	});
        				  	$('#vc').on('click',function(){
        				  		var rand=Math.random();
        				  		var src="{{asset('admin/member/v_code/')}}"+'/'+Math.random();
        				  		$(this).attr('src',src);
        				  	});
        				  </script>       				  
              </div>
              <div class="box-footer">
                <button type="reset" class="btn btn-default col-sm-2 col-sm-offset-2 col-md-2 col-md-offset-2">清空</button>
                <button id="submit" type="submit" class="btn btn-info col-xs-offset-1 col-sm-2 col-sm-offset-1 col-md-2 col-md-offset-1">提交</button>
              </div>
            </form>
            <!-- /.form -->
          </div>
          <!-- /.box -->
	    </div>
    </div>
</section>
<!-- /.content -->
@stop